博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
完成个人中心 导航标签
阅读量:6906 次
发布时间:2019-06-27

本文共 2038 字,大约阅读时间需要 6 分钟。

      1. 个人中心—视图函数带标签页面参数tag
        @app.route('/usercenter/<user_id>/<tag>')
        def usercenter(user_id, tag):
           if tag == ‘1':
               return render_template('usercenter1.html', **context)
      2. 个人中心—导航标签链接增加tag参数
        <li role=“presentation”><a href=“{
        { url_for(‘usercenter’,user_id = user.id,tag = ‘1’) }}">全部问答</a></li>
      3. 个人中心—有链接到个人中心页面的url增加tag参数
        u <a href="{
        { url_for('usercenter',user_id = session.get('userid'), tag=1) }}">{
        { session.get('user') }}</a>
    1. {% extends 'base.html' %} {% block title %}     个人中心 {% endblock %} {% block link %} {% endblock %} {% block box %}     
      {% block subComment %}{% endblock %}
      {% endblock %} {% block script %} {% endblock %}
    2. {% extends 'comment.html' %} {% block subComment %}     
      {% endblock %}

      名称: {
      { user2.username }}

      问题数: {
      { questions|length }}

      评论数: {
      { comment|length }}

转载于:https://www.cnblogs.com/-064/p/8041498.html

你可能感兴趣的文章
Intent(意图)
查看>>
Exchange Server 2007迁移Exchange Server 2010 (2) ---前期准备之二
查看>>
翻译:Fast dynamic extracted honeypots in cloud computing --5.CONCLUSION
查看>>
Effective C++: constexpr(during compilation).
查看>>
TCP/IP协议三次握手流程
查看>>
了解Oracle内核代码层的作用
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
Java学习笔记1-初始化的顺序
查看>>
开源Xen是如何衰落的?
查看>>
Pivot Table系列之切片器 (Slicer)
查看>>
windows下安装mysql5.6及基本命令
查看>>
jsp的九个内置对象简介
查看>>
用户如何获得***服务---步骤与效果
查看>>
学习沟通技巧--- SOFTEN法则与SOLER法则
查看>>
用户密码重设对EFS的影响
查看>>
基于mdrill的大数据分析
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
gitlab web hooks 应用
查看>>